package com.maoyu.cloud.spring.util;

import org.jasypt.util.text.BasicTextEncryptor;

public class JasyptUtil {
    public static String Encrypt(String plaintext,String textKey){
        BasicTextEncryptor textEncryptor = new BasicTextEncryptor();
        textEncryptor.setPassword(textKey);
        return textEncryptor.encrypt(plaintext);
    }
    public static String Decrypt(String ciphertext, String textKey){
        BasicTextEncryptor textEncryptor = new BasicTextEncryptor();
        textEncryptor.setPassword(textKey);
        return textEncryptor.decrypt(ciphertext);
    }

}
